
// 身份证返回日期
export function getBirth (idCard) {
	var birthday = ''
	if (idCard != null && idCard != '') {
		birthday = idCard.slice(6, 14)

		birthday = birthday.replace(/(.{4})(.{2})/, '$1-$2-')
		// 通过正则表达式来指定输出格式为:1990-01-01
	}
	return birthday
}
// 身份证返回性别
export function getSex (idCard) {
	var sexStr = ''
	if (parseInt(idCard.slice(-2, -1)) % 2 == 1) {
		sexStr = '男'
	} else {
		sexStr = '女'
	}
	return sexStr
}
